import request from '@/utils/request'

// 获取空气数据列表
export const getAirDataList = () => {
  return request({
    url: '/air_data',
    method: 'get'
  })
}

// 根据检测地点查询
export const getAirDataBySiteId = (siteId) => {
  return request({
    url: `/air_data/${siteId}`,
    method: 'get'
  })
}

// 根据监测时间查询
export const getAirDataByTime = (date) => {
  return request({
    url: '/air_data/time',
    method: 'get',
    params: {
      recorded_at: date
    }
  })
}

// 根据家庭ID查询
export const getAirDataByFamilyId = (familyId) => {
  return request({
    url: `/air_data/family/${familyId}`,
    method: 'get'
  })
} 